<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <label>考号</label>
    <p><input type="text" id="kh1">
        <input type="button" value="查询">
    </p>
    <p><br/>
    </p>
    <table width="200" border="1">
        <tr>
            <td>状况</td>
            <td>成绩</td>
        </tr>
        <tr>
            <td id="zk1">&nbsp;</td>
            <td id="cj1">&nbsp;</td>
        </tr>
    </table>
    <p>&nbsp;</p>
    <div id="data">
        <label>001</label><label>92</label><br>
        <label>002</label><label>56</label><br>
        <label>003</label><label>63</label><br>
        <label>004</label><label>87</label><br>
        <label>005</label><label>65</label><br>
        <label>006</label><label>57</label><br>
        <label>007</label><label>89</label><br>
        <label>008</label><label>48</label><br>
        <label>009</label><label>77</label><br>
        <label>010</label><label>66</label><br>
    </div>
    <script>
        let kh1 = document.getElementById("kh1");
        let labels = document.querySelectorAll("#data>label");
        let zk1 = document.getElementById("zk1");
        let cj1 = document.getElementById("cj1");
        document.querySelector("[value=查询]").onclick = function(){
            let id = kh1.value;
            for(let i = 0;i < labels.length;i++){
                if(id == labels[i].innerHTML){
                    let score = labels[i + 1].innerHTML;
                    let zk = "";
                    switch(parseInt(score / 10)){
                        case 9: zk = "优秀";break;
                        case 8: zk = "良好";break;
                        case 7: zk = "中等";break;
                        case 6: zk = "及格";break;
                        default: zk = "不及格"
                    }
                    zk1.innerHTML = zk;
                    cj1.innerHTML = score;
                }
            }
        }
    </script>
</body>
</html>